package com.kecheng.xinmei.controller.web;

import com.kecheng.xinmei.entity.*;
import com.kecheng.xinmei.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * @author gaokecheng
 * @version 1.0
 * @date 2020/11/20 4:21 下午
 */
@RestController
@RequestMapping(value = "/web")
public class IndexController {
    @Autowired
    private IndexService indexService;
    @GetMapping(value = "/get_doctor")//首页获取教授信息
    public Doctor getDoctor(){
        return indexService.getDoctor();
    }
    @GetMapping(value = "/get_lunboList")//首页获取轮播图
    public List<Lunbo> getLunbo(){
        return indexService.getLunbo();
    }
    @GetMapping(value = "/get_newsList")//首页获取轮播列表
    public List<News> getNewsList(){
        return indexService.getNewsList();
    }
    @GetMapping(value = "/get_resultList")//研究成果列表
    public List<Result> getResultList() {
        return indexService.getResultList();
    }
    @GetMapping(value = "/get_topic")//获取课题简介
    public Topic getTopic(){
        return indexService.getTopic();
    }
    @GetMapping(value = "/get_personList")//传入1,老师，2.在读学生，3已毕业学生，获取人员列表
    public List<Person> getTeacherList(@RequestParam("type") Integer type){
        return indexService.getTeacherList(type);
    }
    @GetMapping(value = "/get_life")//获取生活影集
    public Life getTLife(){
        return indexService.getLife();
    }
    @GetMapping(value = "/get_introduction")//获取介绍
    public Introduction getIntroduction(){
        return indexService.getIntroduction();
    }
}
